import useIsomorphicLayoutEffect from "../hooks/useIsomorphicLayoutEffect";
import { FC } from "react";

interface WithScaleProps {
  rotation: number;
  scale: number;
  callback(): void;
}

const WithScale: FC<WithScaleProps> = ({
  callback,
  children,
  rotation,
  scale,
}) => {
  useIsomorphicLayoutEffect(() => {
    callback();
  }, [rotation, scale]);
  return <>{children}</>;
};

export default WithScale;
